package common;

import com.github.pagehelper.Page;

/**
 * Created by tangxinmao on 2017/5/26.
 */
public class PageThreadLocal {
    /**
     * create the threadLocal
     */
    public static ThreadLocal<Page> pagerThreadLocal = new ThreadLocal<Page>();

    /**
     * @return
     */
    public static Page getPage() {
        return pagerThreadLocal.get();
    }


    public static void setPage(Page page) {
        pagerThreadLocal.set(page);
    }

    /**
     * when the request is over, remove the pageModel from threadLocal
     */
    public static void remove() {
        pagerThreadLocal.remove();
    }
}